package com.jlpay.openapi.demo.base;

import com.jlpay.open.jlpay.sdk.java.model.base.request.ListBranchBankRequest;
import com.jlpay.open.jlpay.sdk.java.model.base.response.ListBranchBankResponse;
import com.jlpay.open.jlpay.sdk.java.utils.json.JsonUtils;
import com.jlpay.openapi.demo.JlpayOpenApiService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 分支行信息
 *
 * @author zhangyongfeng
 * @date 2025/7/21
 */
public class ListBranchBankService {

    private static final Logger LOGGER = LoggerFactory.getLogger(ListBranchBankService.class);

    public static void main(String[] args) {
        ListBranchBankRequest request = buildRequest();
        ListBranchBankResponse response = JlpayOpenApiService.openMerchService()
                .post(request, ListBranchBankResponse.class);

        LOGGER.info("分支行信息查询响应:{}", JsonUtils.toString(response));
    }

    private static ListBranchBankRequest buildRequest() {
        ListBranchBankRequest request = new ListBranchBankRequest();
        request.setBranchCode("102584002032");
        request.setBranchName("南山");
        request.setBankCode("102");
        request.setLimit(10);
        request.setOffset(0);
        return request;
    }
}
